home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 January to June / Ahoy_Magazine_84-Jan-Jun_1984_Double_L.d64 / locate cursor (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  612b  |  27 lines

  1. 0 rem--ahoy--feb issue--crsrloc--prog page69
  2. 5 rem << crsrloc - locate cursor >>
  3. 10 rem <<listing 1 -9/9/83>>
  4. 20 rem use kernal routine 'plot' to read the cursor's position
  5. 30 print chr$(147) :rem clear screen
  6. 40 rem store machine language in memory
  7. 50 sa = 49168 :rem starting address
  8. 60 x=0
  9. 70 read b
  10. 80 if b=-1 then 130
  11. 90 poke sa+x,b
  12. 95 print sa+x,b
  13. 100 x=x+1
  14. 110 goto 70
  15. 120 data 0,0,56,32,240,255,142,16,192,140,17,192,96,-1
  16. 130 rem--------------------------------
  17. 140 rem find out where cursor is now
  18. 150 gosub 200
  19. 160 print row;col
  20. 170 print tab(20):gosub 200
  21. 180 print row;col
  22. 190 end
  23. 200 sys sa+2: rem get cursor location
  24. 210 row=peek(sa)
  25. 220 col=peek(sa+1)
  26. 230 return
  27.